<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('新增节假日管理')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-holiday-add">
            <div class="form-group">
                <label class="col-sm-3 control-label">配置类型：</label>
                <div class="col-sm-8">
                    <select  class="form-control m-b" th:with="type=${@customDictService.selectDictHolidayConfigType()}" disabled>
                        <option th:each="dict : ${type}" th:text="${dict.title}" th:value="${dict.id}" th:selected="${dict.id} == ${holidayConfig.id}"></option>
                    </select>
                    <input type="hidden" th:value="${holidayConfig.id}"  name="configTypeId">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">例外日期：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="exceptDate" class="form-control" placeholder="yyyy-MM-dd" type="text">
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">例外类型：</label>
                <div class="col-sm-8">
                    <div class="radio-box" th:each="dict : ${@dict.getType('holiday_type')}">
                        <input type="radio" th:id="${'dayType_' + dict.dictCode}" name="dayType" th:value="${dict.dictValue}" th:checked="${dict.default}">
                        <label th:for="${'dayType_' + dict.dictCode}" th:text="${dict.dictLabel}"></label>
                    </div>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">备注：</label>
                <div class="col-sm-8">
                    <textarea name="description" class="form-control" rows="6"></textarea>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "erp/holiday"
        $("#form-holiday-add").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/add", $('#form-holiday-add').serialize());
            }
        }

        $("input[name='exceptDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>